<!DOCTYPE html>
<extend name="Base/base" />
<block name='head'>  
    <meta charset="utf-8">
    <link href="/Public/Index/css/workflow.css" rel="stylesheet" /> 
    <!--文件上传-->
    <script type="text/javascript" src="__PUBLIC__/Cropper/js/ajaxfileupload.js" ></script>
    <style type="text/css">
        .t4{color:#bbb}
        /*出差小结－转交下一步骤开始*/
        .trip_title h2 {
            font-size:1.3em;
            margin:1.2em;
            color:#5077aa;
        }
        .trip_next h3{
            font-size:1em;
            padding:0.8em;
        }
        .trip_next table{
            width:100%;
        }
        .trip_next table tr td{
            border:1px solid #CFDDEA;
            font-size:1.2em;
            padding:0.3em 0;
            text-align: center;
        }
        .trip_next table .value{
            width:75%;
            text-align: left;
            padding-left:10px;
        }
        .trip_next table .value .addUser,.addDept,.addPriv{color:#437dba}
        .trip_next table .key{
            width:20%;
            text-align: center;
            background: #F0F0F0;
        }
        .trip_next table .value .textarea{
            display:inline-block;
            border:1px solid #333;
        }
        .trip_next table .value .textarea span{margin-right:0.5em}
        .trip_next table .value input,.textarea,select,textarea{
            width:60%;
            padding:0.3em;
        }

        .trip_next table .value .date{
            width:45%
        }

        .button .btn-submit{
            padding:0.3em 2em;
            font-size: 1.2em;
        }
        .button span{display:inline-block;margin-left:20%}
        .hide{display:none}
        .submit_tj {
            width: 95%;
            margin: 3.5rem auto;
            clear: both;
        }
        .submit_tj input {
            height: 4rem;
            width: 100%;
            font-size: 1rem;
            border: none;
            border-radius: 6px;
        }
        .submit_tj input.sub_tj {
            background: #267DCE;
            color: #fff;
        }
    </style>
</block>
<block name="content" > 
    <form>
        <div class="bd">
            <div class="trip_title">
                <h2>{$id?'修改':'新建'}公告/通知</h2>
            </div>
            <div class="work_cells trip_next">
                <table>
                    <tr>
                        <td class="key">公告类型</td>
                        <td class="value">
                            <select name="TYPE_ID">
                                <foreach name="cates" item="cate">
                                    <option value="{$cate.code_no}" {$info['type_id'] == $cate['code_no']? 'selected':''}>{$cate.code_name}</option>
                                </foreach>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="key">公告标题</td>
                        <td class="value">
                            <input type="text" name="SUBJECT" value="{$info.subject}">
                        </td>
                    </tr>
                    <tr>
                        <td class="key">按部门发布<br/><span style='color:red;font-zise:0.4em'>(空为全体部门)</span></td>
                        <td class="value">
                            <p class="textarea depart">
                                <span></span>
                    <notempty name='to_ids'>
                        <foreach name='to_ids' item='dept'>
                            <span>
                                <a>{$dept|getDeptName}</a>
                                <img class='pointer delOperator' data-id='{$dept}' src='/Public/Index/img/close_red.png' alt='close' width='12'>
                                <input name='dept_ids[]' value='{$dept}' type='hidden'/>
                                <input name='dept_name[]' vlaue='{$dept|getDeptName}' type='hidden' />
                            </span>
                        </foreach>
                    </notempty>
                    </p>
                    <a class="pointer addDept">+添加 </a>
                    <a class="pointer delData">-清空</a>
                    </td>
                    </tr>
                    <tr>
                        <td class="TableHeader" colspan="2" style="text-align:left;padding-left:10px">
                            <a class="pointer more" title="点击展开/收缩选项"><img src="/Public/Index/img/right.png" align="absMiddle"> 按人员或角色发布</a>
                        </td>
                    </tr> 
                    <tr <if condition="$priv_ids eq null">class="hide"</if>>
                    <td class="key">按角色发布</td>
                    <td class="value">
                        <p class="textarea priv">
                            <span></span>
                    <foreach name='priv_ids' item='priv'>
                        <span>
                            <a>{$priv|getPrivName}</a>
                            <img class='pointer delOperator' data-id='{$priv}' src='/Public/Index/img/close_red.png' alt='close' width='12'>
                            <input name='priv_id[]' value='{$priv}' type='hidden'/>
                            <input name='priv_name[]' vlaue='{$priv|getPrivName}' type='hidden' />
                        </span>
                    </foreach>
                    </p>
                    <a class="pointer addPriv">+添加 </a>
                    <a class="pointer delData">-清空</a>
                    </td>
                    </tr>
                    <tr <if condition="$priv_ids eq null">class="hide"</if>>
                    <td class="key">按人员发布</td>
                    <td class="value">
                        <p class="textarea">
                            <span></span>
                    <foreach name='user_ids' item='user'>
                        <span>
                            <a>{$user|getChineseName}</a>
                            <img class='pointer delOperator' data-id='{$user}' src='/Public/Index/img/close_red.png' alt='close' width='12'>
                            <input name='participator[]' value='{$user}' type='hidden'/>
                            <input name='user_names[]' vlaue='{$user|getChineseName}' type='hidden' />
                        </span>
                    </foreach>
                    </p>
                    <a class="pointer addUser addUser_2" data-id="2" data-key="participator">+添加 </a>
                    <a class="pointer delData">-清空</a>
                    </td>
                    </tr>
                    <tr>
                        <td class="key">有效期</td>
                        <td class="value">
                            <p style="margin-bottom:0.5em">开始：<input type="text" name="BEGIN_DATE" id="start" placeholder="双击打开日历" class="date dateTime" value="{$info.begin_date|date='Y-m-d',###}"/><span style="font-size:0.6em"> 空为立即生效</span></p>
                            <p>结束：<input type="text" name="END_DATE" placeholder="双击打开日历" id="end" class="date dateTime" value="{$info.end_date|date='Y-m-d',###}"/><span style="font-size:0.6em"> 空为手动终止</span></p>
                        </td>
                    </tr>
                    <tr>
                        <td class="key">置顶</td>
                        <td class="value">
                            <input type="checkbox" name="TOP" style='width:16px;' vlaue='{$info.top}' {$info['top'] ? 'checked' :''}>设置为置顶 
                            <input type="text" name="TOP_DAYS" style="width:30px" value='{$info.top_days}'>天后结束置顶
                        </td>
                    </tr>
                    <tr>
                        <td class="key">内容简介</td>
                        <td class="value">
                            <input type="text" name="SUMMARY" value="{$info.summary}">
                        </td>
                    </tr>
                    <tr>
                        <td class="key">附件</td>
                        <td class="value up">
<!--                            <div class="line pointer"><a id="upload" style="color:#437dba;">+ 添加附件</a></div>
                            <div class="line filename-cont">
                                <notempty name='uploads'>
                                    <foreach name="uploads" item="row" key="key">
                                        <span><a href="{$row.url}" download="{$row.name}">{$row.name}</a><img src="/Public/Index/img/close.png" class="pointer delfile" data-fileurl="{$row.url}"/></span><br/>
                                    </foreach>
                                </notempty>
                            </div>-->
                    <notempty name='pcNames'>
                        <div class="line">
                            <span style="color:red;font-size:0.6em;font-weight:bold">PC端上传的文件不可修改</span><br/>
                            <foreach name="pcNames" item='pc'>
                                <span><a href="{$pc.url}" download="{$pc.name}">{$pc.name}</a></span><br/>
                            </foreach>
                        </div>
                    </notempty>
<!--                    <input type="file" id="inputImage" name='imgfile' style="display:none">
                    <input type="hidden" id="filename" name="uploads" value="{$info.uploads}">
                    <input type="hidden" id="fileurl" name="uploads_url" value="{$info.uploads_url}">
                    <input type="hidden" name="url" value="{:U('delFile')}">-->
                    </td>
                    </tr>
                    <tr>
                        <td class="key">内容</td>
                        <td class="value">
                            <textarea name="CONTENT" style="width:80%;height:15em;">{$info.content}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <td class="key">关键词</td>
                        <td class="value">
                            <input type="input" name="KEYWORD" value="{$info.keyword}">
                        </td>
                    </tr>

                    <!--                    <tr>
                                            <td class="key">负责人</td>
                                            <td class="value">
                                                <p class="textarea"><span></span></p>
                                                <a class="pointer addUser addUser_3" data-id="3" data-key="manager">+添加 </a>
                                                <a class="pointer delData">-清空</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key">批注领导</td>
                                            <td class="value">
                                                <p class="textarea"><span></span></p>
                                                <a class="pointer addUser addUser_4" data-id="4" data-key="opinion_leader">+添加 </a>
                                                <a class="pointer delData">-清空</a>
                                            </td>
                                        </tr>-->
                </table>
            </div>
            <input type="hidden" name="id" value="{$id|default=$info['notify_id']}">
<!--            <div class="button">
                <span>
                    <input type="hidden" name="id" value="{$id|default=$info['notify_id']}">
                    <a class="pointer btn-submit ajax-post" data-verify="all" data-url="{:U('saveNotice')}" data-form="" style='background: #5FC6C6'>提交审批</a>
                    <a class="pointer btn-submit ajax-post" data-verify="all" data-url="{:U('saveNotice',array('type'=>1))}" data-form="">保存</a>
                </span>
            </div>-->
        </div>
    </form>
<!--    <div class="button">
        <a class="am-btn" onclick="history.go(-1)">返 回</a>
    </div>-->
    <div class="submit_tj">
        <p><input type="button" class="sub_tj pointer btn-submit ajax-post" data-url="{:U('saveNotice')}" data-form="" value="提&nbsp;&nbsp; 交" ></p>
        <!--<p><input type="button" class="sub_bc pointer btn-submit ajax-post" data-url="{:U('addPlan',array('type'=>1))}" data-form="" value="保&nbsp;&nbsp; 存" ></p>-->
    </div>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Index/js/plan.js"></script>
    <script type="text/javascript" src="/Public/Index/js/notice.js"></script>
    <script type="text/javascript">
            $(dateTime(0));
            $(initAddPlan());
            $(initAddNotice());
            $(initUpload("{:U(CONTROLLER_NAME.'/upload')}"));
    </script>
</block>
